package com.danskin.wechat.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.danskin.wechat.entity.RoleInfo;
import com.danskin.wechat.entity.UserInfo;
import com.danskin.wechat.util.Page;

/**
 * User实体类对应的数据操作类接口
 * @author hanwei
 * @version [版本号:1.0]
 */
public interface UserInfoDao
{
	UserInfo queryByPrimaryKey(int userID);
	
	/**
	 * 用户登陆
	 * @param user 用户对象
	 * @return 用户详情
	 */
	List<UserInfo> queryByUserName(String userName);
	
	List<UserInfo> listPageGetAllUser(Page page);
	
	int updateUserByPrimaryKeySelective(Map<String,Object> map);
	
	UserInfo userLogin(UserInfo user);
	
	int insertSelective(UserInfo user);
	
	List<UserInfo> listPageGetUserByCondtion(Page page);
	
	int insertRelRoleUser(Map<String,Object> map);
	
	int updateRelUserRoleByUserId(Map<String,Object> map);
	
	List<Map<String,Object>> queryRelUserRoleByUserId(Map<String,Object> map);
	
	int deleteUserById(int id);
	//销售端用
	int updateUserInfoTokenByUserName(Map<String,String> map);
	//销售端使用
	UserInfo queryUserInfoByToken(@Param("token") String token);
	
	int deleteRelUserRoleByUserId(int userId);
	
	List<RoleInfo> queryByRoleName(String roleName);
	

}
